<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/auth/templates/template.xhtml">
	<ui:define name="pageTitle">Consultar Despesa</ui:define>
	<ui:define name="body">
		<f:view>

			<f:metadata>
				<f:viewParam name="despesa" value="#{despesaRSBean.despesa}" />
			</f:metadata>

			<p:growl id="messages" autoUpdate="true" closable="true"
				showDetail="true" />

			<h:form id="dados">

				<h:panelGrid cellspacing="10px" styleClass="center">
					<f:facet name="header">Consultar Despesa</f:facet>
					<p:focus context="dados" />
					<h:outputText value="Dados da Despesa" styleClass="header3" />
					<h:panelGrid columns="2" cellspacing="10px">
						<h:outputText value="Descrição:" />
						<h:outputText value="#{despesaRSBean.despesa.descricao}" />
						<h:outputText value="Valor:" />
						<h:outputText value="#{despesaRSBean.despesa.valor}">
							<f:convertNumber currencyCode="BRL" type="currency" />
						</h:outputText>
						<h:outputText value="Dia de Vencimento:" />
						<h:outputText value="#{despesaRSBean.despesa.diaVencimento}" />
						<h:outputText value="Saldo Provisionado:" />
						<h:outputText value="#{despesaRSBean.saldoConta}">
							<f:convertNumber currencyCode="BRL" type="currency" />
						</h:outputText>
					</h:panelGrid>

					<p:dataTable value="#{despesaRSBean.operacoesDespesa}"
						var="operacao" paginator="true" rows="5"
						paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
						rowsPerPageTemplate="5,10,15" sortBy="#{operacao.data.time}">
						<p:column headerText="Data">
							<h:outputText value="#{operacao.data.time}">
								<f:convertDateTime dateStyle="medium" locale="pt_BR" type="both" />
							</h:outputText>
						</p:column>
						<p:column headerText="Histórico">
							<h:outputText value="#{operacao.historico}" />
						</p:column>
						<p:column headerText="Valor">
							<h:outputText value="#{operacao.valor}">
								<f:convertNumber currencyCode="BRL" type="currency" />
							</h:outputText>
						</p:column>
					</p:dataTable>
					<p:commandButton icon="ui-icon-arrowreturnthick-1-e"
						value="Incluir Pagamento de Despesa"
						action="incluirpagamentodespesa?faces-redirect=true&amp;includeViewParams=true">
						<f:setPropertyActionListener target="#{despesaRSBean.despesa}"
							value="#{despesaRSBean.despesa}" />
					</p:commandButton>


				</h:panelGrid>
			</h:form>
		</f:view>
	</ui:define>
</ui:composition>

</html>